<script lang="ts" setup>
import { Document, Menu, Setting } from '@element-plus/icons-vue';
import { useRoute, useRouter } from 'vue-router';

const route=useRoute()
const router=useRouter()
const selectMenu=(path:string)=>{
router.push(path)
}
</script>

<template>
  <div class="user">
    <div class="menu">
      <el-menu :default-active="route.path">
        <el-menu-item @click="selectMenu('/user/certification')" index="/user/certification" >
          <el-icon><Menu /></el-icon>
          <span>实名认证</span>
        </el-menu-item>
        <el-menu-item @click="selectMenu('/user/order')" index="/user/order" >
          <el-icon><document /></el-icon>
          <span>挂号订单</span>
        </el-menu-item>
        <el-menu-item @click="selectMenu('/user/patient')" index="/user/patient">
          <el-icon><Setting /></el-icon>
          <span>就诊人管理</span>
        </el-menu-item>
      <el-menu-item @click="selectMenu('/user/profile')" index="/user/profile">
        <el-icon><Document /></el-icon>
          <span>修改账号信息</span>
        </el-menu-item>
      <el-menu-item @click="selectMenu('/user/feedback')" index="/user/feedback">
        <el-icon><Setting /></el-icon>
          <span>意见反馈</span>
        </el-menu-item>
      </el-menu>
    </div>
    <div class="content">
      <router-view/>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.user {
  display: flex;
  
  .menu {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .content {
    padding-top: 38px;
    flex: 8;
  }
}
</style>